package cn.csc.framework.pay.core.client.impl.tl;

import cn.csc.framework.pay.core.client.PayClientConfig;
import lombok.Data;

import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import javax.validation.constraints.NotBlank;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

@Data
public class TLPayClientConfig implements PayClientConfig {

    @NotBlank(message = "APPID不能为空")
    private String appId;

    /**
     * 商户号
     */
    @NotBlank(message = "商户号不能为空")
    private String mchId;

    /**
     * 支付平安配置不能为空
     */
    private String wxMchId;

    /**
     * 集团模式下不能为空
     */
    private String orgId;

    @NotBlank(message = "签名类型不能为空")
    private String signType;

    @NotBlank(message = "商户秘钥不能为空")
    private String privateKey;

    /**
     * 通联网关地址
     */
    private String serverUrl;

    /**
     * 通联网关地址
     */
    private Map<String,String> serverUrlMap = new HashMap<>();



    @Override
    public Set<ConstraintViolation<PayClientConfig>> verifyParam(Validator validator) {
        return validator.validate(this);
    }

    @Override
    public void validate(Validator validator) {
        PayClientConfig.super.validate(validator);
    }
}
